var qqcs;

 $(function () {

     var resultdata = $("#result").val();
     $("#xs_div").height($(window).height());
     //初始化图表
     if(resultdata){
         initTb(JSON.parse(resultdata));
     }

});

//初始化图表
function initTb(result) {
    require.config({
        paths: {
            echarts: echarts2_dist_url
        }
    });

    require(
        [
            'echarts',
            'echarts/chart/pie'
        ],
        function (ec) {
            var myChart = ec.init(document.getElementById('xs_div'));
            window.onresize = function () {
                if (myChart) {
                    myChart.resize();
                }
            };
            option = {
                tooltip: {
                    trigger: 'item',
                    formatter: "{b}:<br/>共计{c}户 <br/>占比{d}%"
                },
                calculable: true,
                series: [
                    {
                        name: '税务登记总体情况',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '50%'],
                        data: [
                            {value: result["QY_ZCHS"],  name: '正常户企业'},
                            {value: result["QY_FZCHS"], name: '正常户个体'},
                            {value: result["GTH_ZCHS"], name: '正常非企业单位'},
                            {value: result["FQYDW_ZCHS"], name: '非正常户企业'},
                            {value: result["FQYDW_FZCHS"],name: '非正常户个体'},
                            {value: result["GTH_FZCHS"],  name: '非正常非企业单位'}
                        ]
                    }
                ]
            };
            myChart.setOption(option);
        }
    );
}
